package com.local.videoplayer.adapter;

import android.net.Uri;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.facebook.drawee.view.SimpleDraweeView;
import com.local.videoplayer.R;
import com.local.videoplayer.utils.FrescoUtil;
import java.io.File;
import java.util.ArrayList;
import com.local.videoplayer.bean.VideoBean;

/**
 * Created by ccx on 17/3/30.
 */

public class VideoAdapter extends BaseQuickAdapter<VideoBean, BaseViewHolder> {

    public VideoAdapter() {
        super(R.layout.item_video, new ArrayList<VideoBean>());
    }


    @Override
    protected void convert(BaseViewHolder helper, VideoBean item) {
        helper.setText(R.id.tv_video_name, item.videoName);
        //helper.setText(R.id.tv_video_path, item.videoPath);
        //helper.setText(R.id.tv_modify_time, item.updateTime + "");
        //helper.setText(R.id.tv_video_info, item.duration + "s, " + item.size + "");
        helper.setText(R.id.tv_video_duration, item.duration + "s");
        FrescoUtil.loadUrl(Uri.fromFile(new File(item.videoPath)), (SimpleDraweeView) helper.getView(R.id
                .iv_video_pic));
        // helper.setImageBitmap(R.id.iv_video_pic, item.bitmap);

    }

}
